﻿@model PresentationMVC.Models.CustomerDataModel


@using (Html.BeginForm("Save", "Customer", FormMethod.Post))
{
    @Html.ValidationSummary(true, "Customer creation was unsuccessful. Please correct the errors and try again.")
       <div>
        <table width="800px">
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.Title)
                </td>
                <td class="editor-field">
                    @Html.DropDownListFor(m => m.Customer.Title.ID, new SelectList(Model.AllTitle, "ID", "Name", Model.Customer.Title))
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.FirstName)
                </td>
                <td class="editor-label">@Html.TextBoxFor(m => m.Customer.FirstName)<br />
                    @Html.ValidationMessageFor(m => m.Customer.FirstName)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.LastName)
                </td>
                <td class="editor-label">@Html.TextBoxFor(m => m.Customer.LastName)<br />
                    @Html.ValidationMessageFor(m => m.Customer.LastName)
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.CompanyName)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.CompanyName)<br />
                    @Html.ValidationMessageFor(m => m.Customer.CompanyName)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.Email)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.Email)<br />
                    @Html.ValidationMessageFor(m => m.Customer.Email)
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.AddressLine1)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.AddressLine1)<br />
                    @Html.ValidationMessageFor(m => m.Customer.AddressLine1)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.AddressLine2)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.AddressLine2)<br />
                    @Html.ValidationMessageFor(m => m.Customer.AddressLine2)
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.AddressLine3)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.AddressLine3)<br />
                    @Html.ValidationMessageFor(m => m.Customer.AddressLine3)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.City)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.City)<br />
                    @Html.ValidationMessageFor(m => m.Customer.City)
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.County)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.County)<br />
                    @Html.ValidationMessageFor(m => m.Customer.County)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.Postcode)
                </td>
                <td class="editor-label">
                    @Html.TextBoxFor(m => m.Customer.Postcode)<br />
                    @Html.ValidationMessageFor(m => m.Customer.Postcode)
                </td>
                <td class="editor-label">
                    @Html.LabelFor(m => m.Customer.Country)
                </td>
                <td class="editor-label">
                    @Html.DropDownListFor(m => m.Customer.Country.ID, new SelectList(Model.AllCountry, "ID", "Name", Model.Customer.Country))
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Save" id="save" />
                </td>
                <td>
                    @Html.ActionLink(" ", "Index", "Customer", new Object() { }, new { @class = "clear-but" })
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        @Html.HiddenFor(m => m.Customer.ID)
        @Html.HiddenFor(m => m.Customer.InitialEmail)
    </div>
}
